from typing import Optional, Awaitable

from tornado.web import RequestHandler
from services.ReportQueueService import ReportQueueService


class BaseStationReportHandler(RequestHandler):
	def data_received(self, chunk: bytes) -> Optional[Awaitable[None]]:
		pass

	def post(self):
		ReportQueueService.push(ReportQueueService.REPORT_FOR_COMPUTE, self.request.body)
		self.write('ok')


class MainHandler(RequestHandler):
	def data_received(self, chunk: bytes) -> Optional[Awaitable[None]]:
		pass

	def get(self):
		self.write('ok')


class MapHandler(RequestHandler):
	def data_received(self, chunk: bytes) -> Optional[Awaitable[None]]:
		pass

	def get(self):
		self.render('map.html')
